//
//  MineActivityCell.swift
//  HappyEat
//
//  Created by ctx2016 on 17/1/16.
//  Copyright © 2017年 陌路是我. All rights reserved.
//

import UIKit

class MineActivityCell: UITableViewCell {
    var bgView:UIView = UIView.init()
    var titleLabel:UILabel = UILabel.init()
    var bgImageView:UIImageView = UIImageView.init()
    var dateLabel:UILabel = UILabel.init()
    override func awakeFromNib() {
        super.awakeFromNib()
    }
    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)
    }
    override func layoutSubviews() {
        super.layoutSubviews()
    }
    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        self.setUI()
    }
    
    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
    }
}
extension MineActivityCell{
    func setUI(){
        self.contentView.backgroundColor = BackGroundColor
      self.contentView.addSubview(self.bgView)
        self.bgView.snp.makeConstraints { (make) in
            make.left.equalTo(16)
            make.right.equalTo(-16)
            make.top.equalTo(0)
            make.bottom.equalTo(0)
        }
        self.bgView.backgroundColor = .white
        self.bgView.addSubview(self.titleLabel)
        self.bgView.addSubview(self.bgImageView)
        self.bgView.addSubview(self.dateLabel)
        self.titleLabel.snp.makeConstraints { (make) in
            make.left.equalTo(14)
            make.top.equalTo(12.5)
            make.right.equalTo(-14)
            make.height.equalTo(20)
        }
        self.titleLabel.font = UIFont.systemFont(ofSize: 20)
        self.bgImageView.snp.makeConstraints { (make) in
            make.left.equalTo(14)
            make.top.equalTo(self.titleLabel.snp.bottom).offset(8)
            make.right.equalTo(-14)
//            make.bottom.equalTo(-38)
            make.height.equalTo(120)
        }
        self.bgImageView.backgroundColor = .black
        self.dateLabel.snp.makeConstraints { (make) in
            make.left.equalTo(14)
            make.right.equalTo(-14)
            make.top.equalTo(self.bgImageView.snp.bottom).offset(12)
            make.height.equalTo(14)
        }
        self.dateLabel.textAlignment = .right
        self.dateLabel.font = UIFont.systemFont(ofSize: 14)
        self.dateLabel.textColor = BaseFontColor
    }
}
